<template>
  <div v-bind="$attrs">
    我是子组件
    <p>{{ $attrs }}</p>
    <p>{{ attrs.age }}</p>
  </div>
  <div>
    <p>{{ $attrs }}</p>
  </div>
  <hr />
  <WrappedComponent v-bind="$attrs" />
</template>

<script setup lang="ts">
import WrappedComponent from './WrappedComponent.vue'
defineProps({
  name: String
})
import { useAttrs } from 'vue'
const attrs = useAttrs()
console.log(attrs)
</script>
